package com.yict.csms.resourceplan.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.yict.common.entity.PageEntity;
import com.yict.common.service.IBaseService;
import com.yict.csms.resourceplan.dao.IBoxContractorDao;
import com.yict.csms.resourceplan.entity.BoxContractor;
import com.yict.csms.resourceplan.entity.BoxContractorLine;
import com.yict.csms.system.entity.DataDict;
import com.yict.csms.system.entity.User;

public interface IBoxContractorService extends IBaseService<BoxContractor, Long, IBoxContractorDao> {

	/**
	 * 查询数据
	 * @param searchMap 查询条件
	 * @param pageEntity 分页
	 * @return
	 */
	public List<BoxContractor> search(Map<String, Object> searchMap, PageEntity pageEntity);
	/**
	 * 根据工作纸号查行信息
	 * @param workNo
	 * @return
	 */
	public List<BoxContractorLine> search(String workNo);

	/**
	 * 雪箱订更
	 * @param boxContractor
	 * @param boxContractorLines
	 * @return
	 * @throws Exception
	 */
	public boolean update(BoxContractor boxContractor, List<BoxContractorLine> boxContractorLines) throws Exception;
	
	public boolean update(BoxContractorLine boxContractorLine) throws Exception;
	
	/**
	 * 退回订更 
	 * @param bcId
	 * @return
	 */
	public boolean backAssigned(List<Long> bcId);
	/**
	 * 退回已派更
	 * @param bcId
	 * @param us
	 * @return
	 */
	boolean backAssigned(Long bcId, User us);
	/**
	 * 退回未派更
	 * @param bcId
	 * @param dataDict
	 * @param us
	 * @param date
	 * @return
	 */
	public boolean backAssigned(List<Long> bcId, DataDict dataDict, User us, Date date);

	/**
	 * 提交
	 * @param boxContractor
	 * @param boxContractorLines
	 * @return
	 * @throws Exception 
	 */
	public boolean commit(BoxContractor boxContractor, List<BoxContractorLine> boxContractorLines) throws Exception;
	/**
	 * 批量提交
	 * @param boxContractorLines
	 * @return
	 * @throws Exception 
	 */
	public boolean commitAll(List<BoxContractor> boxContractorLines) throws Exception;
	
	public boolean check(Long bcId, boolean isPC);
	
	public boolean commitAll(List<Long> bcIds, DataDict dataDict, User us, Date date) throws Exception;
	
	/**
	 * 根据bcId查找行记录
	 * @param id
	 * @return
	 */
	public List<BoxContractorLine> searchByBcId(Long bcId);
	

}
